3.9 \(\int \tan (c+d x) (a+b \tan (c+d x))^2 (B \tan (c+d x)+C \tan ^2(c+d x)) \, dx\)

Optimal. Leaf size=148 \[ \frac{\left (a^2 C+2 a b B-b^2 C\right ) \log (\cos (c+d x))}{d}-x \left (a^2 B-2 a b C-b^2 B\right )+\frac{(4 b B-a C) (a+b \tan (c+d x))^3}{12 b^2 d}-\frac{b (a C+b B) \tan (c+d x)}{d}+\frac{C \tan (c+d x) (a+b \tan (c+d x))^3}{4 b d}-\frac{C (a+b \tan (c+d x))^2}{2 d} \]

[Out]

-((a^2*B - b^2*B - 2*a*b*C)*x) + ((2*a*b*B + a^2*C - b^2*C)*Log[Cos[c + d*x]])/d - (b*(b*B + a*C)*Tan[c + d*x]
)/d - (C*(a + b*Tan[c + d*x])^2)/(2*d) + ((4*b*B - a*C)*(a + b*Tan[c + d*x])^3)/(12*b^2*d) + (C*Tan[c + d*x]*(
a + b*Tan[c + d*x])^3)/(4*b*d)

________________________________________________________________________________________

Rubi [A]  time = 0.301735, antiderivative size = 148, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 6, integrand size = 38, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.158, Rules used = {3632, 3607, 3630, 3528, 3525, 3475} \[ \frac{\left (a^2 C+2 a b B-b^2 C\right ) \log (\cos (c+d x))}{d}-x \left (a^2 B-2 a b C-b^2 B\right )+\frac{(4 b B-a C) (a+b \tan (c+d x))^3}{12 b^2 d}-\frac{b (a C+b B) \tan (c+d x)}{d}+\frac{C \tan (c+d x) (a+b \tan (c+d x))^3}{4 b d}-\frac{C (a+b \tan (c+d x))^2}{2 d} \]

Antiderivative was successfully verified.

[In]

Int[Tan[c + d*x]*(a + b*Tan[c + d*x])^2*(B*Tan[c + d*x] + C*Tan[c + d*x]^2),x]

[Out]

-((a^2*B - b^2*B - 2*a*b*C)*x) + ((2*a*b*B + a^2*C - b^2*C)*Log[Cos[c + d*x]])/d - (b*(b*B + a*C)*Tan[c + d*x]
)/d - (C*(a + b*Tan[c + d*x])^2)/(2*d) + ((4*b*B - a*C)*(a + b*Tan[c + d*x])^3)/(12*b^2*d) + (C*Tan[c + d*x]*(
a + b*Tan[c + d*x])^3)/(4*b*d)

Rule 3632

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_.)*((A_.) + (B_.)
*tan[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Dist[1/b^2, Int[(a + b*Tan[e + f*x])
^(m + 1)*(c + d*Tan[e + f*x])^n*(b*B - a*C + b*C*Tan[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f, A, B, C, m,
 n}, x] && NeQ[b*c - a*d, 0] && EqQ[A*b^2 - a*b*B + a^2*C, 0]

Rule 3607

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e
_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*B*(a + b*Tan[e + f*x])^(m - 1)*(c + d*Tan[e + f*x])^(n + 1))/(d*
f*(m + n)), x] + Dist[1/(d*(m + n)), Int[(a + b*Tan[e + f*x])^(m - 2)*(c + d*Tan[e + f*x])^n*Simp[a^2*A*d*(m +
 n) - b*B*(b*c*(m - 1) + a*d*(n + 1)) + d*(m + n)*(2*a*A*b + B*(a^2 - b^2))*Tan[e + f*x] - (b*B*(b*c - a*d)*(m
 - 1) - b*(A*b + a*B)*d*(m + n))*Tan[e + f*x]^2, x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, n}, x] && NeQ[b*
c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] && GtQ[m, 1] && (IntegerQ[m] || IntegersQ[2*m, 2*n]) &&
 !(IGtQ[n, 1] && ( !IntegerQ[m] || (EqQ[c, 0] && NeQ[a, 0])))

Rule 3630

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (
f_.)*(x_)]^2), x_Symbol] :> Simp[(C*(a + b*Tan[e + f*x])^(m + 1))/(b*f*(m + 1)), x] + Int[(a + b*Tan[e + f*x])
^m*Simp[A - C + B*Tan[e + f*x], x], x] /; FreeQ[{a, b, e, f, A, B, C, m}, x] && NeQ[A*b^2 - a*b*B + a^2*C, 0]
&&  !LeQ[m, -1]

Rule 3528

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(d
*(a + b*Tan[e + f*x])^m)/(f*m), x] + Int[(a + b*Tan[e + f*x])^(m - 1)*Simp[a*c - b*d + (b*c + a*d)*Tan[e + f*x
], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && GtQ[m, 0]

Rule 3525

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(a*c - b
*d)*x, x] + (Dist[b*c + a*d, Int[Tan[e + f*x], x], x] + Simp[(b*d*Tan[e + f*x])/f, x]) /; FreeQ[{a, b, c, d, e
, f}, x] && NeQ[b*c - a*d, 0] && NeQ[b*c + a*d, 0]

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int \tan (c+d x) (a+b \tan (c+d x))^2 \left (B \tan (c+d x)+C \tan ^2(c+d x)\right ) \, dx &=\int \tan ^2(c+d x) (a+b \tan (c+d x))^2 (B+C \tan (c+d x)) \, dx\\ &=\frac{C \tan (c+d x) (a+b \tan (c+d x))^3}{4 b d}+\frac{\int (a+b \tan (c+d x))^2 \left (-a C-4 b C \tan (c+d x)+(4 b B-a C) \tan ^2(c+d x)\right ) \, dx}{4 b}\\ &=\frac{(4 b B-a C) (a+b \tan (c+d x))^3}{12 b^2 d}+\frac{C \tan (c+d x) (a+b \tan (c+d x))^3}{4 b d}+\frac{\int (a+b \tan (c+d x))^2 (-4 b B-4 b C \tan (c+d x)) \, dx}{4 b}\\ &=-\frac{C (a+b \tan (c+d x))^2}{2 d}+\frac{(4 b B-a C) (a+b \tan (c+d x))^3}{12 b^2 d}+\frac{C \tan (c+d x) (a+b \tan (c+d x))^3}{4 b d}+\frac{\int (a+b \tan (c+d x)) (-4 b (a B-b C)-4 b (b B+a C) \tan (c+d x)) \, dx}{4 b}\\ &=-\left (a^2 B-b^2 B-2 a b C\right ) x-\frac{b (b B+a C) \tan (c+d x)}{d}-\frac{C (a+b \tan (c+d x))^2}{2 d}+\frac{(4 b B-a C) (a+b \tan (c+d x))^3}{12 b^2 d}+\frac{C \tan (c+d x) (a+b \tan (c+d x))^3}{4 b d}+\left (-2 a b B-a^2 C+b^2 C\right ) \int \tan (c+d x) \, dx\\ &=-\left (a^2 B-b^2 B-2 a b C\right ) x+\frac{\left (2 a b B+a^2 C-b^2 C\right ) \log (\cos (c+d x))}{d}-\frac{b (b B+a C) \tan (c+d x)}{d}-\frac{C (a+b \tan (c+d x))^2}{2 d}+\frac{(4 b B-a C) (a+b \tan (c+d x))^3}{12 b^2 d}+\frac{C \tan (c+d x) (a+b \tan (c+d x))^3}{4 b d}\\ \end{align*}

Mathematica [C]  time = 6.22293, size = 221, normalized size = 1.49 \[ \frac{C \tan (c+d x) (a+b \tan (c+d x))^3}{4 b d}+\frac{\frac{(4 b B-a C) (a+b \tan (c+d x))^3}{3 b d}+\frac{2 \left ((b B-a C) \left (-i (a-i b)^2 \log (\tan (c+d x)+i)+i (a+i b)^2 \log (-\tan (c+d x)+i)-2 b^2 \tan (c+d x)\right )-C \left (6 a b^2 \tan (c+d x)+(-b+i a)^3 \log (-\tan (c+d x)+i)-(b+i a)^3 \log (\tan (c+d x)+i)+b^3 \tan ^2(c+d x)\right )\right )}{d}}{4 b} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[c + d*x]*(a + b*Tan[c + d*x])^2*(B*Tan[c + d*x] + C*Tan[c + d*x]^2),x]

[Out]

(C*Tan[c + d*x]*(a + b*Tan[c + d*x])^3)/(4*b*d) + (((4*b*B - a*C)*(a + b*Tan[c + d*x])^3)/(3*b*d) + (2*((b*B -
 a*C)*(I*(a + I*b)^2*Log[I - Tan[c + d*x]] - I*(a - I*b)^2*Log[I + Tan[c + d*x]] - 2*b^2*Tan[c + d*x]) - C*((I
*a - b)^3*Log[I - Tan[c + d*x]] - (I*a + b)^3*Log[I + Tan[c + d*x]] + 6*a*b^2*Tan[c + d*x] + b^3*Tan[c + d*x]^
2)))/d)/(4*b)

________________________________________________________________________________________

Maple [A]  time = 0.013, size = 249, normalized size = 1.7 \begin{align*}{\frac{{b}^{2}C \left ( \tan \left ( dx+c \right ) \right ) ^{4}}{4\,d}}+{\frac{B \left ( \tan \left ( dx+c \right ) \right ) ^{3}{b}^{2}}{3\,d}}+{\frac{2\,C \left ( \tan \left ( dx+c \right ) \right ) ^{3}ab}{3\,d}}+{\frac{Bab \left ( \tan \left ( dx+c \right ) \right ) ^{2}}{d}}+{\frac{C \left ( \tan \left ( dx+c \right ) \right ) ^{2}{a}^{2}}{2\,d}}-{\frac{{b}^{2}C \left ( \tan \left ( dx+c \right ) \right ) ^{2}}{2\,d}}+{\frac{{a}^{2}B\tan \left ( dx+c \right ) }{d}}-{\frac{{b}^{2}B\tan \left ( dx+c \right ) }{d}}-2\,{\frac{Cab\tan \left ( dx+c \right ) }{d}}-{\frac{\ln \left ( 1+ \left ( \tan \left ( dx+c \right ) \right ) ^{2} \right ) Bab}{d}}-{\frac{\ln \left ( 1+ \left ( \tan \left ( dx+c \right ) \right ) ^{2} \right ) C{a}^{2}}{2\,d}}+{\frac{\ln \left ( 1+ \left ( \tan \left ( dx+c \right ) \right ) ^{2} \right ){b}^{2}C}{2\,d}}-{\frac{{a}^{2}B\arctan \left ( \tan \left ( dx+c \right ) \right ) }{d}}+{\frac{B\arctan \left ( \tan \left ( dx+c \right ) \right ){b}^{2}}{d}}+2\,{\frac{C\arctan \left ( \tan \left ( dx+c \right ) \right ) ab}{d}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(d*x+c)*(a+b*tan(d*x+c))^2*(B*tan(d*x+c)+C*tan(d*x+c)^2),x)

[Out]

1/4/d*b^2*C*tan(d*x+c)^4+1/3/d*B*tan(d*x+c)^3*b^2+2/3/d*C*tan(d*x+c)^3*a*b+1/d*B*a*b*tan(d*x+c)^2+1/2/d*C*tan(
d*x+c)^2*a^2-1/2/d*b^2*C*tan(d*x+c)^2+1/d*a^2*B*tan(d*x+c)-1/d*b^2*B*tan(d*x+c)-2/d*C*a*b*tan(d*x+c)-1/d*ln(1+
tan(d*x+c)^2)*B*a*b-1/2/d*ln(1+tan(d*x+c)^2)*C*a^2+1/2/d*ln(1+tan(d*x+c)^2)*b^2*C-1/d*a^2*B*arctan(tan(d*x+c))
+1/d*B*arctan(tan(d*x+c))*b^2+2/d*C*arctan(tan(d*x+c))*a*b

________________________________________________________________________________________

Maxima [A]  time = 1.71334, size = 198, normalized size = 1.34 \begin{align*} \frac{3 \, C b^{2} \tan \left (d x + c\right )^{4} + 4 \,{\left (2 \, C a b + B b^{2}\right )} \tan \left (d x + c\right )^{3} + 6 \,{\left (C a^{2} + 2 \, B a b - C b^{2}\right )} \tan \left (d x + c\right )^{2} - 12 \,{\left (B a^{2} - 2 \, C a b - B b^{2}\right )}{\left (d x + c\right )} - 6 \,{\left (C a^{2} + 2 \, B a b - C b^{2}\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right ) + 12 \,{\left (B a^{2} - 2 \, C a b - B b^{2}\right )} \tan \left (d x + c\right )}{12 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)*(a+b*tan(d*x+c))^2*(B*tan(d*x+c)+C*tan(d*x+c)^2),x, algorithm="maxima")

[Out]

1/12*(3*C*b^2*tan(d*x + c)^4 + 4*(2*C*a*b + B*b^2)*tan(d*x + c)^3 + 6*(C*a^2 + 2*B*a*b - C*b^2)*tan(d*x + c)^2
 - 12*(B*a^2 - 2*C*a*b - B*b^2)*(d*x + c) - 6*(C*a^2 + 2*B*a*b - C*b^2)*log(tan(d*x + c)^2 + 1) + 12*(B*a^2 -
2*C*a*b - B*b^2)*tan(d*x + c))/d

________________________________________________________________________________________

Fricas [A]  time = 1.39793, size = 340, normalized size = 2.3 \begin{align*} \frac{3 \, C b^{2} \tan \left (d x + c\right )^{4} + 4 \,{\left (2 \, C a b + B b^{2}\right )} \tan \left (d x + c\right )^{3} - 12 \,{\left (B a^{2} - 2 \, C a b - B b^{2}\right )} d x + 6 \,{\left (C a^{2} + 2 \, B a b - C b^{2}\right )} \tan \left (d x + c\right )^{2} + 6 \,{\left (C a^{2} + 2 \, B a b - C b^{2}\right )} \log \left (\frac{1}{\tan \left (d x + c\right )^{2} + 1}\right ) + 12 \,{\left (B a^{2} - 2 \, C a b - B b^{2}\right )} \tan \left (d x + c\right )}{12 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)*(a+b*tan(d*x+c))^2*(B*tan(d*x+c)+C*tan(d*x+c)^2),x, algorithm="fricas")

[Out]

1/12*(3*C*b^2*tan(d*x + c)^4 + 4*(2*C*a*b + B*b^2)*tan(d*x + c)^3 - 12*(B*a^2 - 2*C*a*b - B*b^2)*d*x + 6*(C*a^
2 + 2*B*a*b - C*b^2)*tan(d*x + c)^2 + 6*(C*a^2 + 2*B*a*b - C*b^2)*log(1/(tan(d*x + c)^2 + 1)) + 12*(B*a^2 - 2*
C*a*b - B*b^2)*tan(d*x + c))/d

________________________________________________________________________________________

Sympy [A]  time = 1.93907, size = 250, normalized size = 1.69 \begin{align*} \begin{cases} - B a^{2} x + \frac{B a^{2} \tan{\left (c + d x \right )}}{d} - \frac{B a b \log{\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{d} + \frac{B a b \tan ^{2}{\left (c + d x \right )}}{d} + B b^{2} x + \frac{B b^{2} \tan ^{3}{\left (c + d x \right )}}{3 d} - \frac{B b^{2} \tan{\left (c + d x \right )}}{d} - \frac{C a^{2} \log{\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac{C a^{2} \tan ^{2}{\left (c + d x \right )}}{2 d} + 2 C a b x + \frac{2 C a b \tan ^{3}{\left (c + d x \right )}}{3 d} - \frac{2 C a b \tan{\left (c + d x \right )}}{d} + \frac{C b^{2} \log{\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac{C b^{2} \tan ^{4}{\left (c + d x \right )}}{4 d} - \frac{C b^{2} \tan ^{2}{\left (c + d x \right )}}{2 d} & \text{for}\: d \neq 0 \\x \left (a + b \tan{\left (c \right )}\right )^{2} \left (B \tan{\left (c \right )} + C \tan ^{2}{\left (c \right )}\right ) \tan{\left (c \right )} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)*(a+b*tan(d*x+c))**2*(B*tan(d*x+c)+C*tan(d*x+c)**2),x)

[Out]

Piecewise((-B*a**2*x + B*a**2*tan(c + d*x)/d - B*a*b*log(tan(c + d*x)**2 + 1)/d + B*a*b*tan(c + d*x)**2/d + B*
b**2*x + B*b**2*tan(c + d*x)**3/(3*d) - B*b**2*tan(c + d*x)/d - C*a**2*log(tan(c + d*x)**2 + 1)/(2*d) + C*a**2
*tan(c + d*x)**2/(2*d) + 2*C*a*b*x + 2*C*a*b*tan(c + d*x)**3/(3*d) - 2*C*a*b*tan(c + d*x)/d + C*b**2*log(tan(c
 + d*x)**2 + 1)/(2*d) + C*b**2*tan(c + d*x)**4/(4*d) - C*b**2*tan(c + d*x)**2/(2*d), Ne(d, 0)), (x*(a + b*tan(
c))**2*(B*tan(c) + C*tan(c)**2)*tan(c), True))

________________________________________________________________________________________

Giac [B]  time = 4.9075, size = 3008, normalized size = 20.32 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)*(a+b*tan(d*x+c))^2*(B*tan(d*x+c)+C*tan(d*x+c)^2),x, algorithm="giac")

[Out]

-1/12*(12*B*a^2*d*x*tan(d*x)^4*tan(c)^4 - 24*C*a*b*d*x*tan(d*x)^4*tan(c)^4 - 12*B*b^2*d*x*tan(d*x)^4*tan(c)^4
- 6*C*a^2*log(4*(tan(c)^2 + 1)/(tan(d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 -
 2*tan(d*x)*tan(c) + 1))*tan(d*x)^4*tan(c)^4 - 12*B*a*b*log(4*(tan(c)^2 + 1)/(tan(d*x)^4*tan(c)^2 - 2*tan(d*x)
^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1))*tan(d*x)^4*tan(c)^4 + 6*C*b^2*log(4*(ta
n(c)^2 + 1)/(tan(d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c)
+ 1))*tan(d*x)^4*tan(c)^4 - 48*B*a^2*d*x*tan(d*x)^3*tan(c)^3 + 96*C*a*b*d*x*tan(d*x)^3*tan(c)^3 + 48*B*b^2*d*x
*tan(d*x)^3*tan(c)^3 - 6*C*a^2*tan(d*x)^4*tan(c)^4 - 12*B*a*b*tan(d*x)^4*tan(c)^4 + 9*C*b^2*tan(d*x)^4*tan(c)^
4 + 24*C*a^2*log(4*(tan(c)^2 + 1)/(tan(d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^
2 - 2*tan(d*x)*tan(c) + 1))*tan(d*x)^3*tan(c)^3 + 48*B*a*b*log(4*(tan(c)^2 + 1)/(tan(d*x)^4*tan(c)^2 - 2*tan(d
*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1))*tan(d*x)^3*tan(c)^3 - 24*C*b^2*log(4
*(tan(c)^2 + 1)/(tan(d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan
(c) + 1))*tan(d*x)^3*tan(c)^3 + 12*B*a^2*tan(d*x)^4*tan(c)^3 - 24*C*a*b*tan(d*x)^4*tan(c)^3 - 12*B*b^2*tan(d*x
)^4*tan(c)^3 + 12*B*a^2*tan(d*x)^3*tan(c)^4 - 24*C*a*b*tan(d*x)^3*tan(c)^4 - 12*B*b^2*tan(d*x)^3*tan(c)^4 + 72
*B*a^2*d*x*tan(d*x)^2*tan(c)^2 - 144*C*a*b*d*x*tan(d*x)^2*tan(c)^2 - 72*B*b^2*d*x*tan(d*x)^2*tan(c)^2 - 6*C*a^
2*tan(d*x)^4*tan(c)^2 - 12*B*a*b*tan(d*x)^4*tan(c)^2 + 6*C*b^2*tan(d*x)^4*tan(c)^2 + 12*C*a^2*tan(d*x)^3*tan(c
)^3 + 24*B*a*b*tan(d*x)^3*tan(c)^3 - 24*C*b^2*tan(d*x)^3*tan(c)^3 - 6*C*a^2*tan(d*x)^2*tan(c)^4 - 12*B*a*b*tan
(d*x)^2*tan(c)^4 + 6*C*b^2*tan(d*x)^2*tan(c)^4 + 8*C*a*b*tan(d*x)^4*tan(c) + 4*B*b^2*tan(d*x)^4*tan(c) - 36*C*
a^2*log(4*(tan(c)^2 + 1)/(tan(d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan
(d*x)*tan(c) + 1))*tan(d*x)^2*tan(c)^2 - 72*B*a*b*log(4*(tan(c)^2 + 1)/(tan(d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan
(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1))*tan(d*x)^2*tan(c)^2 + 36*C*b^2*log(4*(tan(c)^
2 + 1)/(tan(d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1))
*tan(d*x)^2*tan(c)^2 - 36*B*a^2*tan(d*x)^3*tan(c)^2 + 96*C*a*b*tan(d*x)^3*tan(c)^2 + 48*B*b^2*tan(d*x)^3*tan(c
)^2 - 36*B*a^2*tan(d*x)^2*tan(c)^3 + 96*C*a*b*tan(d*x)^2*tan(c)^3 + 48*B*b^2*tan(d*x)^2*tan(c)^3 + 8*C*a*b*tan
(d*x)*tan(c)^4 + 4*B*b^2*tan(d*x)*tan(c)^4 - 3*C*b^2*tan(d*x)^4 - 48*B*a^2*d*x*tan(d*x)*tan(c) + 96*C*a*b*d*x*
tan(d*x)*tan(c) + 48*B*b^2*d*x*tan(d*x)*tan(c) + 12*C*a^2*tan(d*x)^3*tan(c) + 24*B*a*b*tan(d*x)^3*tan(c) - 24*
C*b^2*tan(d*x)^3*tan(c) - 12*C*a^2*tan(d*x)^2*tan(c)^2 - 24*B*a*b*tan(d*x)^2*tan(c)^2 + 12*C*b^2*tan(d*x)^2*ta
n(c)^2 + 12*C*a^2*tan(d*x)*tan(c)^3 + 24*B*a*b*tan(d*x)*tan(c)^3 - 24*C*b^2*tan(d*x)*tan(c)^3 - 3*C*b^2*tan(c)
^4 - 8*C*a*b*tan(d*x)^3 - 4*B*b^2*tan(d*x)^3 + 24*C*a^2*log(4*(tan(c)^2 + 1)/(tan(d*x)^4*tan(c)^2 - 2*tan(d*x)
^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1))*tan(d*x)*tan(c) + 48*B*a*b*log(4*(tan(c
)^2 + 1)/(tan(d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1
))*tan(d*x)*tan(c) - 24*C*b^2*log(4*(tan(c)^2 + 1)/(tan(d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan
(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1))*tan(d*x)*tan(c) + 36*B*a^2*tan(d*x)^2*tan(c) - 96*C*a*b*tan(d*x)^
2*tan(c) - 48*B*b^2*tan(d*x)^2*tan(c) + 36*B*a^2*tan(d*x)*tan(c)^2 - 96*C*a*b*tan(d*x)*tan(c)^2 - 48*B*b^2*tan
(d*x)*tan(c)^2 - 8*C*a*b*tan(c)^3 - 4*B*b^2*tan(c)^3 + 12*B*a^2*d*x - 24*C*a*b*d*x - 12*B*b^2*d*x - 6*C*a^2*ta
n(d*x)^2 - 12*B*a*b*tan(d*x)^2 + 6*C*b^2*tan(d*x)^2 + 12*C*a^2*tan(d*x)*tan(c) + 24*B*a*b*tan(d*x)*tan(c) - 24
*C*b^2*tan(d*x)*tan(c) - 6*C*a^2*tan(c)^2 - 12*B*a*b*tan(c)^2 + 6*C*b^2*tan(c)^2 - 6*C*a^2*log(4*(tan(c)^2 + 1
)/(tan(d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1)) - 12
*B*a*b*log(4*(tan(c)^2 + 1)/(tan(d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*
tan(d*x)*tan(c) + 1)) + 6*C*b^2*log(4*(tan(c)^2 + 1)/(tan(d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*t
an(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1)) - 12*B*a^2*tan(d*x) + 24*C*a*b*tan(d*x) + 12*B*b^2*tan(d*x) - 1
2*B*a^2*tan(c) + 24*C*a*b*tan(c) + 12*B*b^2*tan(c) - 6*C*a^2 - 12*B*a*b + 9*C*b^2)/(d*tan(d*x)^4*tan(c)^4 - 4*
d*tan(d*x)^3*tan(c)^3 + 6*d*tan(d*x)^2*tan(c)^2 - 4*d*tan(d*x)*tan(c) + d)